package com.ourteam.product.model.api;

import org.apache.commons.lang.BooleanUtils;

import com.ourteam.product.model.domain.ProductModelServiceParameterBean;
import com.ourteam.product.model.service.IProductModelService;
import com.ourteam.product.model.service.ProductModelServiceFactory;

public class ProductModelServiceParameterHelper {

	static final IProductModelService PRODUCT_MODEL_SERVICE = ProductModelServiceFactory.getProductModelService();

	private ProductModelServiceParameterBean modelServiceParameterBean;

	public ProductModelServiceParameterHelper(ProductModelServiceParameterBean modelServiceParameterBean) {
		super();
		this.modelServiceParameterBean = modelServiceParameterBean;
	}

	public String getParameterName() {
		return this.modelServiceParameterBean.getParameterName();
	}

	public String getParameterType() {
		return this.modelServiceParameterBean.getParameterType();
	}

	public String getParameterDataType() {
		return this.modelServiceParameterBean.getDataType();
	}
	
	public String getDataCheck() {
		return this.modelServiceParameterBean.getDataCheck();
	}

	public ProductModelObjectHelper getParameterDataTypeObject() throws Exception {
		return ProductModelObjectHelper.getInstance(this.modelServiceParameterBean.getDataTypeId());
	}

	public boolean isArray() {
		return BooleanUtils.toBoolean(this.modelServiceParameterBean.getIsArray());
	}
}
